home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
bchelp10.zip
/
TI639.ASC
< prev
next >
Wrap
Text File
|
1991-09-17
|
815b
|
67 lines
PRODUCT : C++ NUMBER : 639
VERSION : All
OS : PC DOS
DATE : September 17, 1991 PAGE : 1/1
TITLE : Creating a Pointer to Member Function
#include <stdio.h>
class testclass {
public:
void test(int x) { printf("-> %d <-", x); }
};
void main(void)
{
testclass xxx;
void (testclass::*p_func) (int); // p_func is type pointer to member
// function accepting an int and
// returning void
p_func = testclass::test; // assign p_func the address of test
(xxx.*p_func) (3); // call test
}